Eclipse Platform
Pre-release 3.0

org.eclipse.jface.text.source
Class ProjectionAnnotation

java.lang.Object
  extended byorg.eclipse.jface.text.source.Annotation
      extended byorg.eclipse.jface.text.source.ProjectionAnnotation
All Implemented Interfaces:
IAnnotationPresentation

public class ProjectionAnnotation
extends Annotation
implements IAnnotationPresentation

Annotation used to represent the projection of a master document onto a ProjectionDocument. A projection annotation can be either expanded or collapsed. If expaned it corresponds to a fragment of the projection document. If collapsed, it represents a region of the master document that does not have a corresponding fragment in the projection document.

Draws itself in a tree like fashion.

This class if for internal use only.

Since:
2.1

Field Summary
 
Fields inherited from class org.eclipse.jface.text.source.Annotation
TYPE_UNKNOWN
 
Constructor Summary
ProjectionAnnotation(Position range)
          Creates a new projection annotation for the given range of the master document.
 
Method Summary
 boolean isFolded()
          Returns the state of this annotation.
 void paint(GC gc, Canvas canvas, Rectangle rectangle)
          Implement this method to draw a graphical representation of this annotation within the given bounds.
 void run(ITextViewer viewer)
          Toogles the state of this annotation and updates the given viewer accordingly.
 
Methods inherited from class org.eclipse.jface.text.source.Annotation
drawImage, drawImage, getLayer, getText, getType, isMarkedDeleted, isPersistent, markDeleted, setLayer, setText, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.text.source.IAnnotationPresentation
getLayer
 

Constructor Detail

ProjectionAnnotation

public ProjectionAnnotation(Position range)
Creates a new projection annotation for the given range of the master document.

Parameters:
range - the range.
Method Detail

paint

public void paint(GC gc,
                  Canvas canvas,
                  Rectangle rectangle)
Description copied from interface: IAnnotationPresentation
Implement this method to draw a graphical representation of this annotation within the given bounds.

Specified by:
paint in interface IAnnotationPresentation
Overrides:
paint in class Annotation
Parameters:
canvas - the canvas to draw on
rectangle - the bounds inside the canvas to draw on

run

public void run(ITextViewer viewer)
Toogles the state of this annotation and updates the given viewer accordingly.

Parameters:
viewer - the viewer

isFolded

public boolean isFolded()
Returns the state of this annotation.

Returns:
true if collapsed

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.